package com.chanjet.donkey.repository;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;

import com.chanjet.donkey.entity.Tree;

public class NestSetBehaviorImpl implements NestSetBehaviorCustom {
	@PersistenceContext
	private EntityManager em;
//	void insertBefore(Tree node, Tree to);
//	void insertAfter(Tree node, Tree to);
	
	@Transactional
	public void makeRoot(Tree node) {
		node.setLft(1L);
		node.setRgt(2L);
		node.setDepth(0);
		em.persist(node);
	}
//	void appendTo(Tree node, Tree to);
//	void prependTo(Tree node, Tree to);
}
